# Contributor: Rasmus Thomsen <oss@cogitri.dev>
maintainer="Krassy Boykinov <kboykinov@teamcentrixx.com>"
pkgname=libplist
pkgver=2.6.0
pkgrel=1
pkgdesc="library to handle Apple Property List format whereas it's binary or XML"
url="https://libimobiledevice.org"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
makedepends="
	cython
	glib-dev
	py3-setuptools
	python3-dev
	swig
	"
checkdepends="diffutils"
subpackages="
	$pkgname-static
	$pkgname-dev
	py3-$pkgname:_py3
	$pkgname-util
	$pkgname++:cxx
	$pkgname-doc
	"
source="https://github.com/libimobiledevice/libplist/releases/download/$pkgver/libplist-$pkgver.tar.bz2"
options="!check" # 'huge' test fails on aarch64 builders but passes when ran manually and everywhere else (?)

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

check() {
	make check || {
		cat test/test-suite.log
		return 1
	}
}

package() {
	make DESTDIR="$pkgdir" install
}

util() {
	pkgdesc="Util for libplist"
	amove usr/bin
}

_py3() {
	pkgdesc="Python bindings for libplist"
	amove usr/lib/python3*
}

cxx() {
	pkgdesc="C++ bindings to libplist"
	amove usr/lib/*++*.so.*
}

sha512sums="
67b9ef7c1cf1edd9e0a13462cc21a42dba6bb1ff4465edd56c5d4251e4063e71eb8839ed9952ffb8cdab9cd69ebb4ef46e5f804d3a2b4e44b4e04f6c571398a4  libplist-2.6.0.tar.bz2
"
